package me.fanchaoo.web.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.fanchaoo.web.dto.InitWXJSSDKConfigDTO;
import me.fanchaoo.web.request.InitWXJSSDKRequest;
import me.fanchaoo.web.response.BaseResponse;
import me.fanchaoo.web.service.WeiXinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


import javax.validation.Valid;



@Api(description = "微信")
@RestController
@RequestMapping("/weixin")
public class WeiXinController {
	@Autowired
	private WeiXinService weiXinService;


	@ApiOperation(value = "获取微信签名")
	@PostMapping(value = "/initWXJSSDKConfigInfo")
	public BaseResponse<InitWXJSSDKConfigDTO> initWXJSConfig (@Valid @RequestBody InitWXJSSDKRequest request) throws Exception{
		return 	weiXinService.initJSSDKConfigInfo(request);

	}

}
